package org.sample.springboot.mocker;

import org.sample.springboot.model.Contact;

import java.util.function.Consumer;

public class ContactMocker {

	private ContactMocker() {

	}

	public static interface ContactPropMocker extends Consumer<Contact> {

	}

	public static Contact mock(ContactPropMocker... propMockers) {
		Contact obj = new Contact();

		for (ContactPropMocker propSetter : propMockers) {
			propSetter.accept(obj);
		}

		return obj;
	}

	public static ContactPropMocker phone(String phone) {
		return obj -> obj.setPhone(phone);
	}

	public static ContactPropMocker email(String email) {
		return obj -> obj.setEmail(email);
	}

}
